package cn.gson.boot.model.dao;

import cn.gson.boot.model.pojos.User;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import javax.transaction.Transactional;

public interface EmpDao extends CrudRepository<User,Integer> {
    //移除（逻辑删除）
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true,value = "update user_ set emp_job=0 where emp_id=?1")
    public void yichuEmp(Integer empid);



    //根据员工id修改员工的头像
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true,value = "update user_ set emp_img=?1 where emp_id=?2")
    public void updteEmpImgByEmpId(String empImg,Integer empid);


    //根据员工id修改员工的密码
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true,value = "update user_ set emp_pwd=?1 where emp_id=?2")
    public void updteEmpPasswordByEmpId(String empPwd,Integer empid);
}
